package cn.wizzer.app.user.modules.models.vo;

import cn.wizzer.app.sys.modules.models.SysCurrency;
import cn.wizzer.framework.util.JSONUtil;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;

@Data
public class WalletVO implements Serializable {

    private BigDecimal amount;

    private String logo;

    private Boolean rechargeEnable;

    private Boolean cashEnable;

    private Boolean digital;

    private BigDecimal rate;

    private String name;

    private String currencyId;

    public static WalletVO create(SysCurrency currency,BigDecimal amount){
        WalletVO walletVO = JSONUtil.toJSON(currency).toJavaObject(WalletVO.class);
        walletVO.setCurrencyId(currency.getId());
        walletVO.setAmount(amount);
        return walletVO;
    }
}
